get file extension java

76

get file extension java -

import org.apache.commons.io.FilenameUtils;

String ext1 = FilenameUtils.getExtension("/path/to/file/foo.txt"); // returns "txt"
String ext2 = FilenameUtils.getExtension("bar.exe"); // returns "exe"

Comments

Submit
0 Comments